package kevin.framework.basic.common.utils;

import javax.servlet.http.HttpServletRequest;

import com.alibaba.fastjson.JSONObject;

import kevin.framework.basic.common.ui.ClientButton;

/**
 * 控制器通用接口定义
 * 
 * @author kevin.huang
 *
 */
public interface IControlCommon<T> {

	/**
	 * 扩展datagrid结果集数据，常用于将id转名称
	 * 
	 * @param bean    当前行数据
	 * @param jsonObj 当前行的jsonobject对象
	 */
	public void extGridResult(T bean, JSONObject jsonObj) throws Exception;

	/**
	 * @Title: hasPrivilage @Description: 是否有权限 @param cmd @return @throws
	 */
	public boolean hasDataPrivilage(T bean, HttpServletRequest request, String cmd);

	/**
	 * @Title: hasPrivilage @Description: 是否有权限 @param cmd @return @throws
	 */
	public boolean hasPrivilage(HttpServletRequest request, String cmd);

	/**
	 * @Title: buttonCreanteHanlder @Description: 创建行按钮时候的按钮处理 @param bean @param
	 * button @throws
	 */
	public void buttonCreateHanlder(T bean, ClientButton button);
}